package cn.iocoder.yudao.module.promotion.gift.controller.admin;

import cn.iocoder.yudao.framework.business.basic.controller.PageController;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.gift.pojo.dto.GiftRecordQueryDTO;
import cn.iocoder.yudao.module.promotion.gift.pojo.vo.GiftRecordVO;
import cn.iocoder.yudao.module.promotion.gift.service.core.CoreGiftRecordService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 赠品记录")
@RestController
@RequestMapping("/promotion/gift/record")
@Validated
public class GiftRecordController implements PageController<GiftRecordVO, GiftRecordQueryDTO> {

    @Resource
    private CoreGiftRecordService coreGiftRecordService;

    @PreAuthorize("@ss.hasPermission('promotion:gift:record')")
    @Override
    public CommonResult<PageResult<GiftRecordVO>> getPage(Integer pageNo, Integer pageSize, GiftRecordQueryDTO param) {
        return success(coreGiftRecordService.getPage(pageNo, pageSize, param));
    }

}